package com.tanhua.manage.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.tanhua.manage.mapper.PublishAuditLogMapper;
import com.tanhua.manage.pojo.PublishAuditLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 动态审核日志service
 *
 * @author guzi
 * @date 2021/1/12
 */

@Service
public class PublishAuditLogService {

    @Autowired
    private PublishAuditLogMapper publishAuditLogMapper;

    /**
     * 根据PublishId查询发布日志
     *
     * @param PublishId
     * @return
     */
    public PublishAuditLog queryPublishAuditLogByPublishId(Long PublishId) {
        QueryWrapper<PublishAuditLog> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("user_id", PublishId);
        return this.publishAuditLogMapper.selectOne(queryWrapper);
    }


    /**
     * 根据条件查询发布动态的日志列表
     *
     * @param queryWrapper
     * @return
     */
    public List<PublishAuditLog> queryPublishAuditLogList(QueryWrapper queryWrapper) {
        return this.publishAuditLogMapper.selectList(queryWrapper);
    }
}
